<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('单位管理-下级单位')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row" id="deptdetail">

        <input name="deptid" th:value="${deptid}" type="hidden" id="deptid">
        <input name="jigoujibie" th:value="${jigoujibie}" type="hidden" id="jigoujibie">


        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>单位名称：</label>
                            <input type="text" v-model="jigoumingcheng"/>
                        </li>
                        <li>
                            <label>地区：</label>
                            <input type="text" v-model="diqu"/>
                        </li>
                        <li>
                            <a class="btn btn-success btn-rounded btn-md" @click="bindDeptList"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-md" @click="reset"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">

            <table class="table table-hover table-primary table-striped">
                <thead>
                <tr>
                    <th style="text-align: center; vertical-align: middle;">序号</th>
                    <th style="text-align: center; vertical-align: middle;">单位名称</th>
                    <th style="text-align: center; vertical-align: middle;">单位层级</th>
                    <th style="text-align: center; vertical-align: middle;">地区</th>
                    <th style="text-align: center; vertical-align: middle;">负责人</th>
                    <th style="text-align: center; vertical-align: middle;">负责人办公电话</th>
                    <th style="text-align: center; vertical-align: middle;">单位状态</th>
                    <th style="text-align: center; vertical-align: middle;">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr v-for="(deptitem,index) in deptlist"  v-if="deptlist.length > 0">
                    <td style="vertical-align: middle; text-align: center;" v-text="index+1"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigoumingcheng"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="deptitem.jigoujibie_text"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="deptitem.diqu"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="deptitem.fuzeren"></td>
                    <td style="vertical-align: middle; text-align: center;" v-text="deptitem.fuzerenbangongdianhua"></td>
                    <td style="vertical-align: middle; text-align: center;color:red;" v-if="deptitem.isvalid==0&&deptitem.zuihouxiugaishijian!=null">{{"注销（"+deptitem.zuihouxiugaishijian+")"}}</td>
                    <td style="vertical-align: middle; text-align: center;color:red;" v-else-if="deptitem.isvalid==0&&deptitem.zuihouxiugaishijian==null">{{"注销"}}</td>
                    <td style="vertical-align: middle; text-align: center;color:green;" v-else>正常</td>
                    <td style="vertical-align: middle; text-align: center;" v-text="">
                        <button class="btn btn-success btn-rounded btn-sm" @click="toChakan(deptitem.id)">查看详情</button>
                        <button v-if="jigoujibie<2" class="btn btn-success btn-rounded btn-sm" @click="toXiaji(deptitem)">下级单位</button>
                    </td>
                </tr>
                <tr v-if="deptlist.length == 0">
                    <td style="text-align: center; vertical-align: middle" colspan="8">查无数据</td>
                </tr>
                </tbody>
            </table>
        </div>

        <!-- 查看单位信息 -->
        <div th:replace="system/deptdetail/modal_chakan::dept_chakan"></div>

    </div>
</div>
<th:block th:include="include :: footer" />
<script th:src="@{/js/system/deptdetail/modaldept.js?v=1.2}"></script>

</body>
</html>